
#手机9键盘密码
c = '93 53 63 71 51 63 41 51 83 63 23 23 93 62 61 94 93 71 41 92 41 71 63 41 51 31 83 43 41 21 81 22 21 74 42'
table = ['ABC','DEF','GHI','JKL','MNO','PQRS','TUV','WXYZ']
c = c.split(' ')
c1=''
for i in range(len(c)):
    c1+=table[int(c[i][0])-2][int(c[i][1])-1]
print(c1)

#按照规则，最后一个字母代表加密ATBASH
c1="YLOPJOGJVOCCYNMZYPGXGPOGJDVIG"

import string
a1="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
a2=a1[::-1]

c2=""
for i in c1:
    tmp=a2[a1.index(i)]
    c2+=(tmp)
print(c2)
# qwert

c2="BOLKQLTQELXXBMNABKTCTKLT"
s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
t = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"

c3=""
for i in c2:
    tmp=s[t.index(i)]
    c3+=(tmp)
print(c3)

#REVERSE
c3="XISRASEACSUUXZYKX"
c4=c3[::-1]
print(c4)
#CAESARSIX 凯撒偏移6位
c4="XKYZXUUS"

def caesar(plaintext,x):
    str_list = list(plaintext)
    i = 0
    while i < len(plaintext):
        if not str_list[i].isalpha():
            str_list[i] = str_list[i]
        else:
            a = "A" if str_list[i].isupper() else "a"
            str_list[i] = chr((ord(str_list[i]) - ord(a) - x) % 26 + ord(a) or 5)
        i = i + 1

    return ''.join(str_list)
c5=caesar(c4,6)
print(c5)

print(c5[::-1].lower())
